const fs = require("fs");
const path = require("path");

var stdin = process.stdin;
var arg = process.argv;

if(arg[2] == "mkdir"){
    fs.mkdir("./" + arg[3], (err) => {
        if(err){
            console.log(err);
        }else{
            console.log("文件夹创建成功");
        }
    })
}else if(arg[2] == "touch"){
    fs.writeFile(__dirname + "/" + arg[3], (err) => {
        if(err){
            console.log(err);
        }else{
            console.log("文件创建成功")
        }
    })
}else if(arg[2] == "delete"){
    fs.unlink(__dirname + "/" + arg[3], (err) => {
        if(err){
            console.log(err);
        }else{
            console.log("文件删除成功");
        }
    })
}